package com.quanyan.place.enums;

import com.quanyan.common.enums.BaseEnum;

/**
 * Created by yangyun on 2016/8/8.
 */
public enum PlaceCategoryEnum implements BaseEnum {
    CATEGORY_LQ(1, "LQ", "篮球" ),
    CATEGORY_YQ(2, "YQ", "羽毛球" ),
    CATEGORY_ZQ(3, "ZQ", "足球" ),
    CATEGORY_WQ(4, "WQ", "网球" ),
    ;
   protected int id;

   protected String code;

   protected String label;


    PlaceCategoryEnum(int id, String code, String label) {
        this.id = id;
        this.code = code;
        this.label = label;
    }


    @Override
    public int getId() {
        return id;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getLabel() {
        return label;
    }

    @Override
    public boolean isSuccess() {
    return true;
}

    /**
     * 描述：返回指定id的Enum
     * @param id
     * @return
     */
    public static PlaceCategoryEnum getEnum(int id){
        for (PlaceCategoryEnum tmpEnum : PlaceCategoryEnum.values()) {
            if(tmpEnum.getId() == id)
                return tmpEnum;
        }
        return null;
    }

}


